package com.cyy.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cyy.springbootinit.model.dto.dorimitoryexpensebill.DormitoryExpenseBillQueryRequest;
import com.cyy.springbootinit.model.entity.DormitoryExpenseBill;
import com.cyy.springbootinit.model.vo.DormitoryExpenseBillVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 宿舍水电支出服务
 *
 * @author 程序员cyy</a>
 * @from cyy</a>
 */
public interface DormitoryExpenseBillService extends IService<DormitoryExpenseBill> {

    /**
     * 校验数据
     *
     * @param dormitoryExpenseBill
     * @param add 对创建的数据进行校验
     */
    void validDormitoryExpenseBill(DormitoryExpenseBill dormitoryExpenseBill, boolean add);

    /**
     * 获取查询条件
     *
     * @param dormitoryExpenseBillQueryRequest
     * @return
     */
    QueryWrapper<DormitoryExpenseBill> getQueryWrapper(DormitoryExpenseBillQueryRequest dormitoryExpenseBillQueryRequest);
    
    /**
     * 获取宿舍水电支出封装
     *
     * @param dormitoryExpenseBill
     * @param request
     * @return
     */
    DormitoryExpenseBillVO getDormitoryExpenseBillVO(DormitoryExpenseBill dormitoryExpenseBill, HttpServletRequest request);

    /**
     * 分页获取宿舍水电支出封装
     *
     * @param dormitoryExpenseBillPage
     * @param request
     * @return
     */
    Page<DormitoryExpenseBillVO> getDormitoryExpenseBillVOPage(Page<DormitoryExpenseBill> dormitoryExpenseBillPage, HttpServletRequest request);

    List<DormitoryExpenseBill> getRecentBill( Integer dormitoryId);
}
